<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes"/>

<!-- ========================= -->
<!-- root element: salesOrderAcknowledgement -->
<!-- ========================= -->


<xsl:template match="salesOrderAcknowledgement">

	<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:variable name="logoPath" select="logo"/>
	<fo:layout-master-set>
		<fo:simple-page-master master-name="simpleA4"
        		page-height="11in"
        		page-width="8.5in"
        		margin-top="20mm"
        		margin-bottom="20mm"
      			margin-left="7mm"
      			margin-right="10mm" >

			<fo:region-after extent="3mm"/>

			<fo:region-body />

  		</fo:simple-page-master>
       <fo:simple-page-master master-name="termsAndConditionsMasterName"
        		page-height="9in"
        		page-width="11.69in"
        		margin-top="5mm"
        		margin-bottom="0.30in"
      			margin-left="7mm"
      			margin-right="10mm" >
            <fo:region-before extent="0mm"/>
			<fo:region-after extent="3mm"/>
			<fo:region-body margin-top="0mm" margin-bottom="0.65in"/>
  		</fo:simple-page-master>
    </fo:layout-master-set>




<fo:page-sequence master-reference="simpleA4">

<!--============================== -->
<!-- Page Number block             -->
<!-- Modified By Basha (12/24/2003)-->
<!--============================== -->

<fo:static-content flow-name="xsl-region-after">
	<fo:block font-size="7pt" font-weight="bold" text-align="right">
        Page <fo:page-number />
	<!--
	<xsl:value-of select="count(/packingSlip/lineItems/lineItem)"/>
	-->
	 of
	<fo:page-number-citation ref-id="endofdoc"/>

	<!--
	<fo:page-number-citation ref-id="last-page"/>
	-->

        </fo:block>
</fo:static-content>

<fo:flow flow-name="xsl-region-body">

<!--==============================-->
<!-- Logo and Self address block  -->
<!-- Modified By Prabhanjan (12/24/2003)-->
<!--==============================-->

	<fo:block font-size="8pt" space-after="1cm">
	<fo:table table-layout="fixed" width="100%" >

	<fo:table-column column-width="10mm" />
	<fo:table-column column-width="35mm"/>
	<fo:table-column column-width="20mm" />
	<fo:table-column display-align="center" />
	<fo:table-column />


	<fo:table-body>
		<fo:table-row>
			<fo:table-cell />

			<fo:table-cell>

				<fo:external-graphic src="{$logoPath}" content-height = ".5in"  content-width = ".5in" />

<!-- 			<fo:external-graphic src="url('file:c:///scalar_logo.jpg')" content-height = ".5in"  content-width = ".5in" /> -->

			<!--<xsl:apply-template match="logo">
				<fo:external-graphic content-height = ".5in"  content-width = ".5in" >
					<xsl:attribute name="src" >
						<xsl:value-of select="logo" />
					</xsl:attribute>
				</fo:external-graphic>

			</xsl:apply-template>-->
		     	</fo:table-cell>

			<fo:table-cell />

		     	<fo:table-cell text-align="center" width="100%">
		     		<!-- <fo:block font-size="12pt" font-weight="bold" display-align="center">Sales Order Acknowledgement</fo:block> -->
                    <fo:block font-size="12pt" font-weight="bold"><xsl:value-of select="heading"/></fo:block>
                    <xsl:apply-template match="selfAddress">
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//name" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address1" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address2" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address3" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//address4" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//cityStateZip" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="selfAddress//phoneFax" /></fo:block>
			  	    </xsl:apply-template>
		     	</fo:table-cell>

			<fo:table-cell />
		</fo:table-row>
	</fo:table-body>
	</fo:table >
	</fo:block>

<!--==============================-->
<!-- From and To addresses block  -->
<!-- Modified By Prabhanjan (12/24/2003)-->
<!--==============================-->


	<fo:table table-layout="fixed" width="102%" space-after="0.5cm">
		<fo:table-column column-width="71mm"/>
		<fo:table-column column-width="2mm" />
		<fo:table-column column-width="64mm" />
		<fo:table-column column-width="2mm" />
		<fo:table-column column-width="64mm"/>


		<fo:table-body>
			<fo:table-row>
				<fo:table-cell hyphenate="true" language="en" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="orderByAddress"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell/>

				<fo:table-cell hyphenate="true" language="en" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="billToAddress"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell/>

				<fo:table-cell hyphenate="true" language="en" >
			 		<fo:block font-size="8pt" > <xsl:apply-templates select="shipToAddress"/> </fo:block>
				</fo:table-cell>

			</fo:table-row>
		</fo:table-body>
	</fo:table>


<!--===============================-->
<!-- Information block             -->
<!-- Modified By Prabhanjan (12/24/2003)-->
<!--===============================-->


	<fo:block font-size="8pt" space-after="0.5cm">
		<xsl:apply-templates select="information"/>
	</fo:block>


<!--=============================== -->
<!-- Comments Instructions block    -->
<!--=============================== -->


	<fo:block font-size="8pt" font-weight="bold" space-after="0.5mm" text-decoration="underline">Comments:</fo:block>
        <fo:block font-size="8pt" background-color="#FFFFEE" space-after="0.5cm" > <xsl:value-of select="comments"/> </fo:block>

<!--=============================== -->
<!-- Line Items details block      -->
<!--=============================== -->

	<fo:block font-size="8pt" space-after="0.5cm">
	        <xsl:apply-templates select="lineItems"/>
        </fo:block>

    <fo:block font-weight="bold" text-align="left" font-size="8pt" space-after="0.5cm">
        <xsl:value-of select="/salesOrderAcknowledgement/lineItemsNotPresentMessage"/>
    </fo:block>

<!--=============================== -->
<!-- End User details block      -->
<!--=============================== -->

	<fo:table table-layout="fixed" width="102%" space-after="1cm">
		<fo:table-column  column-width="40mm"/>
		<fo:table-column  column-width="28mm"/>
		<fo:table-column  column-width="32mm"/>

		<fo:table-body>
			<fo:table-row>
				<fo:table-cell>
					<fo:block font-size="7pt" > <xsl:apply-templates select="endUser"/> </fo:block>
				</fo:table-cell>

				<fo:table-cell />
				<fo:table-cell>
					<fo:block font-size="8pt" > <xsl:apply-templates select="total"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="salesTax"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="freight"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="misc"/> </fo:block>
					<fo:block font-size="8pt" > <xsl:apply-templates select="balanceDue"/> </fo:block>
				</fo:table-cell>

			</fo:table-row>
		</fo:table-body>
	</fo:table>

    <fo:table table-layout="note" width="102%" space-after="1cm">
            <fo:table-column  column-width="100mm"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell>
                        <fo:block font-size="7pt" > <xsl:apply-templates select="notes"/> </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>


<!--=============================== -->
<!-- Terms and Conditionsblock      -->
<!--=============================== -->
<!--
<fo:block font-size="8pt"  break-before="page" font-weight="bold" text-align="center" space-after="0.2cm"> Terms And Conditions </fo:block>
<fo:block font-size="8pt"  text-align="center" space-after="0.5cm">
	<xsl:apply-template match="selfAddress">
		<fo:block font-size="7pt" ><xsl:value-of select="clientName" /></fo:block>
        <fo:block font-size="7pt" ><xsl:value-of select="clientAddress" /></fo:block>
	</xsl:apply-template>
</fo:block>
<fo:block font-size="8pt" space-after="2cm"> <xsl:apply-templates select="termsAndConditions"/> </fo:block>
-->

<!-- Inorder to get page count -->

<fo:block id="endofdoc"></fo:block>
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="termsAndConditionsMasterName">
    <fo:flow flow-name="xsl-region-body">
        <fo:block><div style="page-break-before: always"/></fo:block>
        <fo:block font-size="8pt" space-after="2cm">
            <fo:table margin="2mm" table-layout="fixed"  width="100%">
            <fo:table-column  column-width="285mm"/>
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell>
                            <fo:block font-size="8pt" space-after="2cm"> <xsl:apply-templates select="termsAndConditions"/> </fo:block>
                            <!--<xsl:apply-template match="termsAndConditions">
                            <fo:external-graphic width="70cm" height="50cm" content-width="70cm" content-height="50cm" display-align="center" text-align="center">
                                <xsl:attribute name="src">
                                    <xsl:value-of select="termsPage1"/>
                                </xsl:attribute>
                            </fo:external-graphic>
                            </xsl:apply-template>-->
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:block>
    </fo:flow>
</fo:page-sequence>

</fo:root>
</xsl:template>



<!-- ================================ -->
<!--	child element: Self Address     -->
<!-- ================================ -->
<!-- Modified By Prabhanjan (12/24/2003) -->

<xsl:template match="selfAddress">
	<fo:table width="100%" table-layout="fixed">
	<fo:table-column />
		<fo:table-body>
			<fo:table-row>
				<fo:table-cell text-align="center">

					<fo:block font-weight="bold">Self Address:</fo:block>
					<fo:block><xsl:value-of select="name"/></fo:block>
					<fo:block><xsl:value-of select="address1"/></fo:block>
					<fo:block><xsl:value-of select="address2"/></fo:block>
					<fo:block><xsl:value-of select="address3"/></fo:block>
					<fo:block><xsl:value-of select="phone"/></fo:block>
					<fo:block><xsl:value-of select="fax"/></fo:block>
					<fo:block>Email: <xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- ================================ -->
<!--  Child element: Order By Address  -->
<!-- ================================ -->
<!-- Modified By Prabhanjan (12/24/2003) -->

<xsl:template match="orderByAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Ordered By:</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

				<!--<fo:block><xsl:value-of select="name"/></fo:block>-->
				<fo:block><xsl:value-of select="address1"/></fo:block>
                <fo:block><xsl:value-of select="contactPerson"/></fo:block>
				<fo:block><xsl:value-of select="address2"/></fo:block>
				<fo:block><xsl:value-of select="address3"/></fo:block>
                <fo:block><xsl:value-of select="address4"/></fo:block>
                <fo:block><xsl:value-of select="city"/></fo:block>
                <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
				<fo:block><xsl:value-of select="phone"/></fo:block>
                <fo:block><xsl:value-of select="cell"/></fo:block>
				<fo:block><xsl:value-of select="fax"/></fo:block>
				<fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>



<!-- ================================ -->
<!--  Child element: Bill To Address  -->
<!-- ================================ -->
<!-- Modified By Prabhanjan (12/24/2003) -->


<xsl:template match="billToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Bill To:</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

                    <!--<fo:block><xsl:value-of select="name"/></fo:block>-->
                    <fo:block><xsl:value-of select="address1"/></fo:block>
                    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
                    <fo:block><xsl:value-of select="address2"/></fo:block>
                    <fo:block><xsl:value-of select="address3"/></fo:block>
                    <fo:block><xsl:value-of select="address4"/></fo:block>
                    <fo:block><xsl:value-of select="city"/></fo:block>
                    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
                    <fo:block><xsl:value-of select="phone"/></fo:block>
                    <fo:block><xsl:value-of select="cell"/></fo:block>
                    <fo:block><xsl:value-of select="fax"/></fo:block>
                    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>




<!-- =================================== -->
<!--	Child element: Ship To Address   -->
<!-- =================================== -->
<!-- Modified By Prabhanjan (12/24/2003) -->


<xsl:template match="shipToAddress">
	<fo:table margin="2mm" width="100%" table-layout="fixed">
		<fo:table-column />
	        <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold">Ship To:</fo:block>
				</fo:table-cell>
			</fo:table-row>

			<fo:table-row height="4cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="top">

                    <!--<fo:block><xsl:value-of select="name"/></fo:block>-->
                    <fo:block><xsl:value-of select="address1"/></fo:block>
                    <fo:block><xsl:value-of select="contactPerson"/></fo:block>
                    <fo:block><xsl:value-of select="address2"/></fo:block>
                    <fo:block><xsl:value-of select="address3"/></fo:block>
                    <fo:block><xsl:value-of select="address4"/></fo:block>
                    <fo:block><xsl:value-of select="city"/></fo:block>
                    <fo:block><xsl:value-of select="stateZipCountry"/></fo:block>
                    <fo:block><xsl:value-of select="phone"/></fo:block>
                    <fo:block><xsl:value-of select="cell"/></fo:block>
                    <fo:block><xsl:value-of select="fax"/></fo:block>
                    <fo:block><xsl:value-of select="email"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>


<!-- =================================== -->
<!--	child element: Information       -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->


<xsl:template match="information">
	<fo:block font-size="7pt">
	<fo:table table-layout="fixed" width="100%">
		<fo:table-column column-width="71mm"/>
		<fo:table-column column-width="2mm"/>
		<fo:table-column column-width="64mm"/>
		<fo:table-column column-width="2mm"/>
		<fo:table-column column-width="64mm"/>


	        <fo:table-body>
			<fo:table-row height="0.5cm" >

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column column-width="30mm"/>
				<fo:table-column column-width="30mm"/>
                <fo:table-column column-width="11mm"/>


				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="center">Customer PO#</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="center"><xsl:value-of select="/salesOrderAcknowledgement/salesOrderNoFieldHeading"/></fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Change#</fo:block>
						</fo:table-cell>

					</fo:table-row>
					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="center">
							<xsl:value-of select="customerPO"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="center">
							<xsl:value-of select="salesOrder"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="center">
							<xsl:value-of select="changeNumber"/>
							</fo:block>
						</fo:table-cell>

					</fo:table-row>

				</fo:table-body>
			</fo:table>
			</fo:table-cell>

			<fo:table-cell />

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column />
				<fo:table-column />

				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Order Date</fo:block>
						 </fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Ship Via</fo:block>
						</fo:table-cell>

					</fo:table-row>
					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="orderDate"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="shipVia"/>
							</fo:block>
						</fo:table-cell>
					</fo:table-row>

				</fo:table-body>
			</fo:table>
			</fo:table-cell>

			<fo:table-cell />

			<fo:table-cell display-align="top">
			<fo:table width="100%" table-layout="fixed">
				<fo:table-column column-width="16mm"/>
				<fo:table-column column-width="19mm"/>
				<fo:table-column column-width="14.5mm"/>
				<fo:table-column column-width="14.5mm"/>

				<fo:table-body>
					<fo:table-row height="0.5cm" background-color="#DEE1E2">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Sales Person</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Regional Rep</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Del Terms</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">Pay Terms</fo:block>
						</fo:table-cell>

					</fo:table-row>
					<fo:table-row  height="0.4cm" background-color="#FFFFEE">
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="salesPerson"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="regionalRep"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="delTerms"/>
							</fo:block>
						</fo:table-cell>
						<fo:table-cell border="1pt double black" display-align="center">
							<fo:block font-weight="bold" text-align="left">
							<xsl:value-of select="payTerms"/>
							</fo:block>
						</fo:table-cell>

					</fo:table-row>

				</fo:table-body>
			</fo:table>
		</fo:table-cell>
	</fo:table-row>

	</fo:table-body>
	</fo:table>
        </fo:block>
</xsl:template>

<!-- =================================== -->
<!--	child element: LineItems. 	     -->
<!--    Modified by Prabhajnan           -->
<!-- =================================== -->

<xsl:template match="lineItems">
	<fo:block font-size="7pt">
        <fo:table margin="2mm" width="100%" table-layout="fixed">
		    <fo:table-column column-width="7mm"/>
	        <fo:table-column column-width="10mm"/>
		    <fo:table-column column-width="14mm"/>
	        <fo:table-column column-width="4mm"/>
 		    <fo:table-column column-width="25mm"/>
	        <fo:table-column column-width="15mm"/>
	        <fo:table-column column-width="15mm"/>
	        <fo:table-column column-width="13mm"/>
		    <fo:table-column column-width="13mm"/>
	        <fo:table-column column-width="13mm"/>
		    <fo:table-column column-width="10mm"/>
	        <fo:table-column column-width="11mm"/>
            <fo:table-column column-width="21mm"/>
	        <fo:table-column column-width="32mm"/>

            <fo:table-body>
			<fo:table-row height="0.6cm" background-color="#DEE1E2">
				<fo:table-cell border="1pt double black" display-align="center" >
			    		<fo:block font-weight="bold" text-align="center">PO Line#</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Req Qty</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Remaining Qty</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">UM</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
                      <fo:block font-weight="bold" text-align="center">
                          <xsl:choose>
                              <xsl:when test="showMktgPartNumber = 'true'">
                                  <xsl:value-of select="labelMktgPartNumber"/>
                              </xsl:when>
                              <xsl:otherwise>
                                  <xsl:value-of select="labelMfgPartNumber"/>
                              </xsl:otherwise>
                          </xsl:choose>
                      </fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center"><xsl:value-of select="labelCustPartNumber"/></fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
		    			<fo:block font-weight="bold" text-align="center">Description</fo:block>
	  			</fo:table-cell>
	  			<fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Requested Dock Date</fo:block>
				</fo:table-cell>
				<fo:table-cell border="1pt double black" display-align="center" >
					<fo:block font-weight="bold" text-align="center">Schedule Ship Date</fo:block>
				</fo:table-cell>
				<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Revised Ship Date</fo:block>
				</fo:table-cell>
       			<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Taxable</fo:block>
					<fo:block font-weight="bold" text-align="center">Yes or No</fo:block>
				</fo:table-cell>
                <fo:table-cell border="1pt double black" display-align="center">
                    <fo:block font-weight="bold" text-align="center">Expedite Fee</fo:block>
                    <fo:block font-weight="bold" text-align="center">Yes or No</fo:block>
                </fo:table-cell>
       			<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Unit Price</fo:block>
				</fo:table-cell>
	       			<fo:table-cell border="1pt double black" display-align="center">
					<fo:block font-weight="bold" text-align="center">Extended Price</fo:block>
				</fo:table-cell>
			</fo:table-row>

            <xsl:for-each select="/salesOrderAcknowledgement/lineItems/group">
                    <xsl:for-each select="lineItem">
                        <fo:table-row height="0.4cm" background-color="#FFFFEE">
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="poLineItem"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="reqQty"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="remainingQty"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" >
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="um"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                                <fo:block font-weight="bold" text-align="left">
                                    <xsl:choose>
                                      <xsl:when test="../../showMktgPartNumber = 'true'">
                                          <xsl:value-of select="mktgPartNumber"/>
                                      </xsl:when>
                                      <xsl:otherwise>
                                          <xsl:value-of select="mfgPartNumber"/>
                                      </xsl:otherwise>
                                  </xsl:choose>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                                <fo:block font-weight="bold" text-align="left">
                                <xsl:value-of select="customerPartNumber"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                                <fo:block font-weight="bold" text-align="left">
                                <xsl:value-of select="description"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="requestDate"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="scheduleDate"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="revisedShipDate"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="taxable"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center">
                                <fo:block font-weight="bold" text-align="center">
                                <xsl:value-of select="expediteFee"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                                <fo:block font-weight="bold" text-align="right">
                                <xsl:value-of select="unitPrice"/>
                                </fo:block>
                            </fo:table-cell>
                            <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                                <fo:block font-weight="bold" text-align="right" >
                                <xsl:value-of select="extendedPrice"/>
                                </fo:block>
                            </fo:table-cell>

                        </fo:table-row>

                    </xsl:for-each>

                <fo:table-row height="0.4cm" background-color="#FFFFFF">
                    <!-- Modified by Prabhanjan (3 Arp 2004) -->
                    <fo:table-cell number-columns-spanned="2" border="1pt double black" display-align="center" >
                        <fo:block font-weight="bold" text-align="right">Sub Total</fo:block>
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="center"><xsl:value-of select="subTotalQty"/></fo:block>
                    </fo:table-cell>
                    <fo:table-cell number-columns-spanned="10" border="1pt double black" display-align="center" >
                    </fo:table-cell>
                    <fo:table-cell border="1pt double black" display-align="center" hyphenate="true" language="en">
                        <fo:block font-weight="bold" text-align="right"><xsl:value-of select="subTotalAmt"/></fo:block>
                    </fo:table-cell>
                </fo:table-row>
           </xsl:for-each>
		</fo:table-body>
	</fo:table>
	</fo:block>
</xsl:template>

<!-- =================================== -->
<!--	child element: End User      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="endUser">

    <fo:table margin="2mm" width="75%" table-layout="fixed">
		<fo:table-column column-width="25mm" />
        <fo:table-column column-width="25mm"/>
        <fo:table-column column-width="25mm"/>
            <fo:table-body>
			<fo:table-row height="0.5cm">
				<fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/end_user_Label"/></fo:block>
				</fo:table-cell>
                <fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/end_customer_Label"/></fo:block>
				</fo:table-cell>
                <fo:table-cell background-color="#DEE1E2" border="1pt double black" display-align="center">
				<fo:block font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/quatation_no_label"/></fo:block>
				</fo:table-cell>
            </fo:table-row>

			<fo:table-row height="0.5cm">
				<fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="center">
					<fo:block hyphenate="true" language="en"><xsl:value-of select="/salesOrderAcknowledgement/endUser"/></fo:block>
				</fo:table-cell>
                <fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="center">
					<fo:block hyphenate="true" language="en"><xsl:value-of select="/salesOrderAcknowledgement/endCustomer"/></fo:block>
				</fo:table-cell>
                <fo:table-cell font-weight="bold" background-color="#FFFFEE" border="1pt double black" display-align="center">
					<fo:block hyphenate="true" language="en"><xsl:value-of select="/salesOrderAcknowledgement/quatationNo"/></fo:block>
				</fo:table-cell>
            </fo:table-row>
		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Total      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="total">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold"  border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Total</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/salesOrderAcknowledgement/total"/></fo:block>

				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Sales Tax      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="salesTax">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Sales Tax</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/salesOrderAcknowledgement/salesTax"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>


<!-- =================================== -->
<!--	child element: Freight      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="freight">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Freight</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/salesOrderAcknowledgement/freight"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>


<!-- =================================== -->
<!--	child element: Misc      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="misc">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold" ><xsl:value-of select="/salesOrderAcknowledgement/misc/@name"/></fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/salesOrderAcknowledgement/misc"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Balance Due      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="balanceDue">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		<fo:table-column />

	        <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block font-weight="bold">Balance Due</fo:block>
				</fo:table-cell>

				<fo:table-cell font-weight="bold" border="1pt double black" display-align="center">
					<fo:block text-align="right"><xsl:value-of select="/salesOrderAcknowledgement/balanceDue"/></fo:block>
				</fo:table-cell>
			</fo:table-row>

		</fo:table-body>
	</fo:table>
</xsl:template>

<xsl:template match="notes">
   <xsl:if test="termsLabel!=''">
    <fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2">
		<fo:table-column />
		    <fo:table-body>
			<fo:table-row height="0.4cm">
				<fo:table-cell font-weight="bold" display-align="center">
					<fo:block ><xsl:value-of select="termsLabel"/>
                    </fo:block>
				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
   </xsl:if>
</xsl:template>
    <!-- =================================== -->
<!--	child element: Terms And Conditions      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="termsAndConditions">
    <xsl:if test="isTermsFromDB='false'">
        <fo:external-graphic width="70cm" height="50cm" content-width="70cm" content-height="50cm" display-align="center" text-align="center">
                <xsl:attribute name="src">
                    <xsl:value-of select="termsPage1"/>
                </xsl:attribute>
        </fo:external-graphic>
    </xsl:if>
    <xsl:if test="isTermsFromDB='true'">
    <fo:table margin="2mm" width="102%" table-layout="fixed">
		<fo:table-column />
		<!-- <fo:table-column column-width="5mm"/> -->
		<!-- <fo:table-column /> -->
            <fo:table-body>
			<fo:table-row height="0.4cm">
                <fo:table-cell>
                        <fo:block> <xsl:apply-templates select="termsfromdb"/> </fo:block>
                </fo:table-cell>
                <!--
                    <fo:table-cell />
                    <fo:table-cell>
                        <fo:block> <xsl:apply-templates select="term2"/> </fo:block>
                    </fo:table-cell>
                -->
			</fo:table-row>
		</fo:table-body>
	</fo:table>
    </xsl:if>
</xsl:template>

<!-- =================================== -->
<!--	child element: Term1      -->
<!--   Modified By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<xsl:template match="term1">

        <fo:table margin="0.5mm" width="102%" table-layout="fixed"  background-color="#DEE1E2" font-size="6pt" >
	    	<fo:table-column />

	        <fo:table-body>
            <xsl:for-each select="/salesOrderAcknowledgement/termsAndConditions/term1/termAndCondition">
			<fo:table-row height="0.4cm">
				<fo:table-cell hyphenate="true" language="en" >
					<fo:block text-align="justify">
						<fo:inline text-decoration="underline"><xsl:value-of select="title" /></fo:inline>
						<xsl:value-of select="description"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			</xsl:for-each>
		</fo:table-body>
	</fo:table>
</xsl:template>

<xsl:template match="termsfromdb">
    <fo:block font-size="7pt"  text-align="center" space-after="0.5cm">
                <xsl:apply-template match="/salesOrderAcknowledgement/selfAddress">
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/selfAddress//name" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/selfAddress//address1" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/selfAddress//address2" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/selfAddress//address3" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/selfAddress//address4" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/selfAddress//cityStateZip" /></fo:block>
                        <fo:block font-size="7pt" font-weight="bold"><xsl:value-of select="/salesOrderAcknowledgement/selfAddress//phoneFax" /></fo:block>
			  	    </xsl:apply-template>
            </fo:block>
     <fo:block font-size="12pt"  text-align="center" space-after="0.5cm">
                TERMS AND CONDITIONS OF SALES</fo:block>
    <fo:table margin="0.5mm" width="102%" table-layout="fixed"  background-color="#DEE1E2" font-size="6pt" >
		<fo:table-column />
	        <fo:table-body>
            <xsl:for-each select="/salesOrderAcknowledgement/termsAndConditions/termsfromdb/termAndConditionFromDB">
			<fo:table-row height="0.4cm">
				<fo:table-cell hyphenate="true" language="en" >
					<fo:block text-align="justify" space-after="0.3cm">
						<fo:inline text-decoration="underline"><xsl:value-of select="title" /></fo:inline>
						<xsl:for-each select="description/subDescription">
                            <fo:block text-align="justify" >
                            <xsl:value-of select="subDescriptionValue"/>
                            </fo:block>
                        </xsl:for-each>
                    </fo:block>
				</fo:table-cell>
			</fo:table-row>
			</xsl:for-each>
		</fo:table-body>
	</fo:table>
</xsl:template>

<!-- =================================== -->
<!--	child element: Term2      -->
<!--   Commented By Prabhanjan (12/24/2003) -->
<!-- =================================== -->

<!--
<xsl:template match="term2">
	<fo:table margin="2mm" width="100%" table-layout="fixed" background-color="#DEE1E2" font-size="6pt" >
		<fo:table-column />

	        <fo:table-body>
			<xsl:for-each select="/salesOrderAcknowledgement/termsAndConditions/term2/termAndCondition">
			<fo:table-row height="0.4cm">
				<fo:table-cell>
					<fo:block text-align="justify">
						<fo:inline text-decoration="underline"><xsl:value-of select="title" /></fo:inline>
						<xsl:value-of select="description"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			</xsl:for-each>
		</fo:table-body>
	</fo:table>
</xsl:template>

-->

<!-- =================================== -->
<!--	END of Document		         -->
<!-- =================================== -->

</xsl:stylesheet>